﻿@model BlogWeb.Models.BlogView

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@Styles.Render("~/Content/admin/css/maininfo")

@using (Html.BeginForm())
{
    //这个是用来生成隐藏的防伪标记
    @Html.AntiForgeryToken() 
       <!--main_top-->
    <table width="99%" border="0" cellspacing="0" cellpadding="0" id="searchmain">
        <tr>
            <td width="99%" align="left" valign="top">您的位置：博客管理&nbsp;&nbsp;>&nbsp;&nbsp;添加博客</td>
        </tr>
        <tr>
            <td align="left" valign="top" id="addinfo">
                <a href="add.html" target="mainFrame" onFocus="this.blur()" class="add">新增博客</a>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" id="main-tab">
                    <tr onMouseOut="this.style.backgroundColor='#ffffff'" onMouseOver="this.style.backgroundColor='#edf5ff'">
                        <td align="right" valign="middle" class="borderright borderbottom bggray">博客标题：</td>
                        <td align="left" valign="middle" class="borderright borderbottom main-for">
                            @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "text-word" } })
                            @Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" })
                        </td>
                    </tr>
                    <tr onMouseOut="this.style.backgroundColor='#ffffff'" onMouseOver="this.style.backgroundColor='#edf5ff'">
                        <td align="right" valign="middle" class="borderright borderbottom bggray">图片标题：</td>
                        <td align="left" valign="middle" class="borderright borderbottom main-for">
                            @Html.EditorFor(model => model.PicTitle, new { htmlAttributes = new { @class = "text-word"} })
                            <span class="input-group-btn">
                                <button type="button" id="j_upload_img_btn" class="btn btn-primary">上传图片</button>
                            </span>
                            @Html.ValidationMessageFor(model => model.PicTitle, "", new { @class = "text-danger" })
                        </td>
                    </tr>
                    <tr onMouseOut="this.style.backgroundColor='#ffffff'" onMouseOver="this.style.backgroundColor='#edf5ff'">
                        <td align="right" valign="middle" class="borderright borderbottom bggray">博客内容：</td>
                        <td align="left" valign="middle" class="borderright borderbottom main-for">
                            @* 这里将会生成 <TextArea id="TextArea" ……>的标签 *@
                            @Html.TextAreaFor(model => model.Content)
                            @Html.ValidationMessageFor(model => model.Content, "", new { @class = "text-danger" })
                            @Html.ValidationSummary(true, "", new { @class = "text-danger" })
                        </td>
                    </tr>

                    <tr onMouseOut="this.style.backgroundColor='#ffffff'" onMouseOver="this.style.backgroundColor='#edf5ff'">
                        <td align="right" valign="middle" class="borderright borderbottom bggray">&nbsp;</td>
                        <td align="left" valign="middle" class="borderright borderbottom main-for">
                            <input name="" type="submit" value="提交" class="text-but">
                            <input name="" type="reset" value="重置" class="text-but" >
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <textarea id="uploadEditor" style="display: none;"></textarea>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/UEditor/Config")
    @Scripts.Render("~/UEditor/uploadimg")
    <script>
        //创建UEditor编辑器 把编辑器创建到id="Content"的TextArea标签中
        var editor = UE.getEditor("Content", {
            UEDITOR_HOME_URL: '/ueditor/',
            iframeCssUrl: '/ueditor/themes/iframe.css',
            autoHeightEnabled: true,
            initialFrameHeight: 400,
            initialFrameWidth: 1000
        });
    </script>
}
